﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModelDesignEduse;
using ModelDesignEduse.Tests;

namespace Program
{
    class Program
    {
        static void Main(string[] args)
        {
            /*
            IndexCategory indexCategory1 = new IndexCategory();

            indexCategory1.index_category_id = 1;
            indexCategory1.index_category_name = "Main";

            IndexCategory indexCategory2 = new IndexCategory();

            indexCategory2.index_category_id = 2;
            indexCategory2.index_category_name = "Description";

            List<IndexCategory> indexCategories = new List<IndexCategory>();

            indexCategories.AddRange(new IndexCategory[] { indexCategory1, indexCategory2 });

            Language turkish = new Language();

            turkish.language_id = 1;
            turkish.language_name = "Türkçe";

            Language english = new Language();

            english.language_id = 2;
            english.language_name = "English";

            List<Language> languages = new List<Language>();

            languages.AddRange(new Language[] { turkish, english });

            Index index = new Index();

            index.index_id = 1;
            index.index_category_id = indexCategory1.index_category_id;

            List<Index> indices = new List<Index>();

            indices.Add(index);

            IndexText indexTextTurkish = new IndexText();

            indexTextTurkish.index_id = index.index_id;
            indexTextTurkish.language_id = turkish.language_id;
            indexTextTurkish.index_text = "Saymanın Temel İlkesi";

            IndexText indexTextEnglish = new IndexText();

            indexTextEnglish.index_id = index.index_id;
            indexTextEnglish.language_id = english.language_id;
            indexTextEnglish.index_text = "Principles of Counting";

            List<IndexText> indexTexts = new List<IndexText>();

            indexTexts.AddRange(new IndexText[] { indexTextTurkish, indexTextEnglish });

            var result = from text in indexTexts
                         join lang in languages
                         on text.language_id equals lang.language_id
                         where lang.language_name == "Türkçe"
                         select text.index_text;

            foreach (string name in result)
                Console.WriteLine("Name = " + name);
             */
            Program program = new Program();

            program.PopulateTesters();
            
            foreach (ITester tester in program.testers)
                tester.Run();
        }

        public void PopulateTesters()
        {
            IndexingTest indexingTester = new IndexingTest();
            PageAdditionTest pat = new PageAdditionTest();
            PageTypeAdditionTest ptat = new PageTypeAdditionTest();
            PageAddTest padt = new PageAddTest();

            //testers.Add(indexingTester);
            //testers.Add(pat);
            //testers.Add(ptat);
            testers.Add(padt);
        }

        List<ITester> testers = new List<ITester>();
    }
}
